package com.codeplay.service;

import com.codeplay.entity.Role;
import java.util.List;
import java.util.Set;

public interface RoleService {
    // 基础CRUD操作
    Role createRole(Role role, Set<String> permissionNames);
    Role updateRole(Long id, Role role);
    void deleteRole(Long id);
    Role getRoleById(Long id);
    Role getRoleByName(String name);
    List<Role> getAllRoles();
    
    // 权限管理
    void assignPermissions(Long roleId, Set<String> permissionNames);
    void removePermissions(Long roleId, Set<String> permissionNames);
    
    // 角色验证
    boolean existsByName(String name);
    
    // 获取角色的所有权限
    Set<String> getRolePermissions(Long roleId);
} 